/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package job.manager.db.ec;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Administrator
 */
@Entity
@Table(name = "TimeReport")
@NamedQueries({@NamedQuery(name = "TimeReportEB.findAll", query = "SELECT t FROM TimeReportEB t"),@NamedQuery(name = "TimeReportEB.findByPid", query = "SELECT t FROM TimeReportEB t WHERE t.profileId = :profileId"),@NamedQuery(name = "TimeReportEB.findByPidDateSorted", query = "SELECT t FROM TimeReportEB t WHERE t.profileId = :profileId ORDER BY t.scheduleRowId.dateTime"), @NamedQuery(name = "TimeReportEB.findById", query = "SELECT t FROM TimeReportEB t WHERE t.id = :id"), @NamedQuery(name = "TimeReportEB.findByCode", query = "SELECT t FROM TimeReportEB t WHERE t.code = :code"), @NamedQuery(name = "TimeReportEB.findByFromSystemId", query = "SELECT t FROM TimeReportEB t WHERE t.fromSystemId = :fromSystemId")})
public class TimeReportEB implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "code")
    private int code;
    @Basic(optional = false)
    @Column(name = "fromSystemId")
    private int fromSystemId;
    @Lob
    @Column(name = "comment")
    private String comment;
    @JoinColumn(name = "jobId", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private JobEB jobId;
    @JoinColumn(name = "profileId", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private ProfilesEB profileId;
    @JoinColumn(name = "scheduleRowId", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private TimeScheduleRowEB scheduleRowId;

    public TimeReportEB() {
    }

    public TimeReportEB(Integer id) {
        this.id = id;
    }

    public TimeReportEB(Integer id, int code, int fromSystemId) {
        this.id = id;
        this.code = code;
        this.fromSystemId = fromSystemId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public int getFromSystemId() {
        return fromSystemId;
    }

    public void setFromSystemId(int fromSystemId) {
        this.fromSystemId = fromSystemId;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public JobEB getJobId() {
        return jobId;
    }

    public void setJobId(JobEB jobId) {
        this.jobId = jobId;
    }

    public ProfilesEB getProfileId() {
        return profileId;
    }

    public void setProfileId(ProfilesEB profileId) {
        this.profileId = profileId;
    }

    public TimeScheduleRowEB getScheduleRowId() {
        return scheduleRowId;
    }

    public void setScheduleRowId(TimeScheduleRowEB scheduleRowId) {
        this.scheduleRowId = scheduleRowId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TimeReportEB)) {
            return false;
        }
        TimeReportEB other = (TimeReportEB) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "job.manager.db.ec.TimeReportEB[id=" + id + "]";
    }

}
